package org.example.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.example.entity.system.PermOption;
import org.example.entity.system.Permission;

import java.util.List;
import java.util.Map;

/**
 * @author 魏锴
 * @description 针对表【tb_sys_perm】的数据库操作Service
 * @createDate 2024-01-11 15:16:46
 */
public interface PermissionService extends IService<Permission> {
    boolean insertPermission(Permission permission);

    boolean updatePermission(Permission permission);

    boolean deletePermission(int id);

    List<Permission> getPermissionList();

    List<Integer> getPermsByRoles(List<Integer> role_ids);

    List<PermOption> getPermOpsByRoleId(int role_id);
    Map<String, String> getPermissionIdMap();

    boolean grantPermission(int user_id,int role_id);
    boolean revokePermission(int user_id,int role_id);
}
